home *** CD-ROM | disk | FTP | other *** search
-
-
-
- ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUULLLLiiiisssstttt((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUULLLLiiiisssstttt((((3333xxxx))))
-
-
-
- NNNNAAAAMMMMEEEE
- cpusetGetCPUList - get the list of all CPUs assigned to a cpuset
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ccccppppuuuusssseeeetttt....hhhh>>>>
-
- ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt ****ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUULLLLiiiisssstttt((((cccchhhhaaaarrrr ****qqqqnnnnaaaammmmeeee))));;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The _c_p_u_s_e_t_G_e_t_C_P_U_L_i_s_t function is used to obtain the list of the CPUs
- assigned to the specified cpuset. Only processes running with a user ID
- or group ID that has read access permissions on the permissions file can
- successfully execute this function. The qqqqnnnnaaaammmmeeee argument is the name of
- the specified cpuset.
-
- The function returns a pointer to a structure of type ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt
- (defined in <cpuset.h>). The function _c_p_u_s_e_t_G_e_t_C_P_U_L_i_s_t allocates the
- memory for the structure and the user is responsible for freeing the
- memory using the function _c_p_u_s_e_t_F_r_e_e_C_P_U_L_i_s_t(3x). The ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt
- structure looks similar to this:
-
- typedef struct {
- int count;
- pid_t *list;
- } cpuset_CPUList_t;
-
-
- ccccoooouuuunnnntttt is the number of CPU IDs in the list. lllliiiisssstttt references the memory
- array that holds the list of CPU IDs. The memory for lllliiiisssstttt is allocated
- when the ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt is allocated and it is released when the
- ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt structure is released.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- This example obtains the list of CPUs asigned to the cpuset mpi_set and
- prints out the CPU ID values.
-
- char *qname = "mpi_set";
- cpuset_CPUList_t *cpus;
-
- /* Get the list of CPUs else print error & exit */
- if ( !(cpus = cpusetGetCPUList(qname)) ) {
- perror("cpusetGetCPUList");
- exit(1);
- }
- if (cpus->count == 0) {
- printf("CPUSET[%s] has 0 assigned CPUs\n",
- qname);
- } else {
- int i;
-
- printf("CPUSET[%s] assigned CPUs:\n",
- qname);
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUULLLLiiiisssstttt((((3333xxxx)))) ccccppppuuuusssseeeettttGGGGeeeettttCCCCPPPPUUUULLLLiiiisssstttt((((3333xxxx))))
-
-
-
- for (i = 0; i < cpus->count; i++)
- printf("CPU_ID[%d]\n", cpus->list[i]);
- }
- cpusetFreeCPUList(cpus);
-
-
- NNNNOOOOTTTTEEEESSSS
- _c_p_u_s_e_t_G_e_t_C_P_U_L_i_s_t is found in the library "libcpuset.so", and will be
- loaded if the option _----_llll_cccc_pppp_uuuu_ssss_eeee_tttt is used with _cccc_cccc(1) or _llll_dddd(1).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- cpuset(1), cpusetFreeCPUList(3x), cpuset(5).
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- If successful, _c_p_u_s_e_t_G_e_t_C_P_U_L_i_s_t returns a pointer to a ccccppppuuuusssseeeetttt____CCCCPPPPUUUULLLLiiiisssstttt____tttt
- structure. If _c_p_u_s_e_t_G_e_t_C_P_U_L_i_s_t fails, it returns NULL and eeeerrrrrrrrnnnnoooo is set
- to indicate the error. The possible values for eeeerrrrrrrrnnnnoooo include those
- values as set by _s_y_s_m_p(2) and _s_b_r_k(2).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-